//
// Created by d on 1/14/17.
//
#include "pyboostcvconverter/pyboostcvconverter.hpp"
#include <opencv2/opencv.hpp>
#include <stdlib.h>
#include <stdio.h>

using namespace pbcvt;
char images[][80] = {
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image072.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image005.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image023.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image074.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image053.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image017.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image014.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image064.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image042.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image030.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image019.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image062.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image041.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image040.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image038.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image060.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image037.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image034.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image058.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image039.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image061.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image065.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image049.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image070.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image021.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image079.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image051.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image001.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image033.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image086.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image057.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image025.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image036.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image075.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image043.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image069.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image009.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image055.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image076.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image089.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image031.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image087.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image028.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image082.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image084.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image045.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image081.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image012.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image085.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image052.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image032.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image035.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image078.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image068.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image022.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image044.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image011.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image047.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image010.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image073.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image046.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image029.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image066.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image054.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image020.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image050.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image015.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image003.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image056.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image027.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image071.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image018.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image083.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image024.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image067.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image026.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image016.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image006.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image008.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image080.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image088.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image013.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image002.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image063.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image048.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image077.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image004.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image007.png",
        "/home/d/data/ddb1_v02_01/images/diaretdb1_image059.png"
};


int main() {
    printf("%ld", sizeof(int));
#pragma omp parallel for shared(images)
    for (int i = 0; i < 89; i++) {
        printf("handling %s\n", images[i]);
        char outfilename[100];
        Mat img = cv::imread(images[i]);
        Mat oimg = vessel_seg(img, i);
        sprintf(outfilename,"out/%d_out.png", i);
        cv::imwrite(outfilename, oimg);
        sprintf(outfilename,"out/%d_in.png", i);
        cv::imwrite(outfilename, img);
    }
    return 0;
}